using System;
using digit.Core;

namespace SMS.UserManager
{
    public class MemberState
    {
        #region CONSTRUCTIONS
        static MemberState() { }
        #endregion

        #region PROPERTIES
        public static bool IsAuthenticated
        {
            get
            {
                object objMember = Util.GetSession("Member");
                if ((objMember == null) || !(objMember is IMember)) return false;
                return true;
            }
        }

        public static bool IsAuthorized
        {
            get
            {
                return false;
            }
        }

        public static IMember Member
        {
            get
            {
                if (!MemberState.IsAuthenticated) return null;
                return (IMember)Util.GetSession("Member");
            }
        }
        #endregion

        #region METHODS

        public static bool HasActions(string action)
        {
            return false;
        }

        #endregion
    }
}
